<?php

function controller_exists( $c )
{
	$a = controller::parse_action( (string)($c).'::index' );
	$c = $a['class'];

	return class_exists( $c );
}

function create_func ( $args, $code )
{
	if (phpversion()>=5.3)
		return create_function( $args, $code );
	
	static $n = 0;
	
	$functionName = sprintf ( 'mylambda_%d', ++$n );
	$declaration = sprintf ( 'function %s(%s) {%s}' , $functionName , $args , $code );
	eval( $declaration );
	return $functionName ;
}

function callback_escape_data( $data )
{
	return "unserialize('" . serialize( $data ) . "')";
}

